﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>学生成绩管理系统</title>
    
	<link rel="stylesheet" href="${pageContext.request.contextPath}/tool/materialize/css/materialize.min.css"/>
    <!-- Bootstrap Styles-->
    <link href="${pageContext.request.contextPath}/tool/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="${pageContext.request.contextPath}/tool/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="${pageContext.request.contextPath}/tool/css/custom-styles.css" rel="stylesheet" />
    
</head>
<body>
	<nav class="navbar navbar-default top-navbar" role="navigation">
		<div class="navbar-header">

			<a class="navbar-brand waves-effect waves-dark" href="${pageContext.request.contextPath}/homepage/studentjsp"><i class="large material-icons">track_changes</i> <strong>成绩管理系统</strong></a>

			<div id="sideNav" href=""><i class="material-icons dp48">toc</i></div>
		</div>

		<ul class="nav navbar-top-links navbar-right">
			<li>
				<a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1"><i class="fa fa-user fa-fw"></i> <b>${students.name}</b> <i class="material-icons right">arrow_drop_down</i></a>
			</li>
		</ul>
	</nav>
	<!--登陆的用户 -->
	<ul id="dropdown1" class="dropdown-content">
		<li>
			<a href="${pageContext.request.contextPath}/student/userinfo"><i class="fa fa-user fa-fw"></i>个人信息</a>
		</li>
		<li><a href="" data-toggle="modal" data-target="#myModal"><i
				class="fa fa-gear fa-fw"></i>修改密码</a></li>
		<li>
			<a href="${pageContext.request.contextPath}/homepage/studentquit" onclick="javascript:return del();"><i class="fa fa-sign-out fa-fw"></i>安全退出</a>
		</li>
	</ul>

	<nav class="navbar-default navbar-side" role="navigation">
		<div class="sidebar-collapse">
			<ul class="nav" id="main-menu">

				<li>
					<a href="${pageContext.request.contextPath}/homepage/studentjsp" class="waves-effect waves-dark"><i class="fa fa-dashboard"></i>学生功能介绍</a>
				</li>

				<li>
					<a href="${pageContext.request.contextPath}/student/userinfo" class="waves-effect waves-dark"><i class="fa fa-table"></i>个人信息</a>
				</li>

				<li>
					<a href="#" class="active-menu waves-effect waves-dark"><i class="fa  fa-github-square" aria-hidden="true"></i>考试成绩</a>
				</li>
				<li>
					<a href="${pageContext.request.contextPath}/student/showall" class="waves-effect waves-dark"><i class="fa fa-bookmark" aria-hidden="true"></i>班级成员</a>
				</li>
			</ul>

		</div>

	</nav>

	<div id="page-wrapper">
		<div class="header">
			<h1 class="page-header">
                           		考试成绩
                        </h1>
		</div>

		<div id="page-inner">

			<div class="row">
				<div class="col-md-12">
					<div class="card">
						<div class="card-content">
							 <div class="table-responsive">
                                <table class="table table-hover">
                                    <thead>
                                        <tr>
                                            <th class="center">编号</th>
                                            <th class="center">课程</th>
                                            <th class="center">任课老师</th>
                                            <th class="center">成绩</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                       <c:forEach items="${grades }" var="c">
                                       		<tr>
                                       			<td class="center">${c.id }</td>
                                       			<td class="center">${c.teacher.course }</td>
                                       			<td class="center">${c.teacher.tcname }</td>
                                       			<c:if test="${c.grade !=null}">
                                       			<td class="center">${c.grade }分</td>
                                       			</c:if>
                                       			<c:if test="${c.grade ==null}">
                                       			<td class="center">暂无考试成绩</td>
                                       			</c:if>
                                       		</tr>
                                       </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                            </div>
					</div>
				</div>
			</div>

		</div>
	</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true"
		style="background-color: rgba(0, 0, 0, 0); width: 100%; height: 1088px;">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">修改密码	用户：${students.name }</h4>
				</div>
				<form action="${pageContext.request.contextPath}/student/xgpassword" method="get" id="myform" >
					<div class="modal-body">
						<input type="hidden" id="jmm1" value="${students.password }">

						<p>
							<label>旧密码：</label><input type="password" id="jmm">
						</p>
						<p>
							<label>新密码：</label><input type="password" id="xmm">
						</p>
						<p>
							<label>重新输入新密码：</label><input type="password" name="password" id="password">
						</p>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
						<button type="submit" class="btn btn-primary" onclick="javascript:return dell();">提交更改</button>
					</div>
				</form>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>


  
</body>
<!-- jQuery Js -->
    <script src="${pageContext.request.contextPath}/tool/js/jquery-1.10.2.js"></script>
	
	<!-- Bootstrap Js -->
    <script src="${pageContext.request.contextPath}/tool/js/bootstrap.min.js"></script>
	<!--//用户-->
	<script src="${pageContext.request.contextPath}/tool/materialize/js/materialize.min.js"></script>
	
    <!-- Metis Menu Js -->
    <script src="${pageContext.request.contextPath}/tool/js/jquery.metisMenu.js"></script>
    <!-- Morris Chart Js -->
	
	
	<script src="${pageContext.request.contextPath}/tool/js/easypiechart.js"></script>
	
	 <!-- DATA TABLE SCRIPTS -->
    <script src="${pageContext.request.contextPath}/tool/js/dataTables/jquery.dataTables.js"></script>
   
    <!-- Custom Js -->
    <script src="${pageContext.request.contextPath}/tool/js/custom-scripts.js"></script> 
 	<script type="text/javascript">
 	function del(){
 		var msg = "确定要退出?\n\n请选择!";
 		if (confirm(msg)==true){
 		return true; 
 		}else{ 
 		return false; 
 		}
 	};
 	function dell(){
 		var jmm1=$("#jmm1").val();
		var jmm=$("#jmm").val();
		var xmm=$("#xmm").val();
		var password=$("#password").val();
			if(jmm==""){
				alert("请输入旧密码！");
				return false;
			}else if(jmm1!=jmm){
				alert("旧密码输入错误！");
				return false;
			}else if(xmm==""){
				alert("请输入新密码!");
				return false;
			}else if(password==""){
				alert("请重复输入新密码!");
				return false;
			}else if(xmm!=password){
				alert("两次密码输入不一样!");
				return false;  
			}else{
				return true;
				}
 	};
 	</script>
</html>
